<div id="tiga_ba">
	<div id="tiga_baa">Data Tindakan </div>
	<div id="tiga_bac">
		<a href="utama.php?module=mod_bantuan&view=master" target="_BLANK">
			<img src="asset/images/bantuan.png" width="30">
		</a>
	</div>
	<div id="tiga_bab">
		<a href="javascript:void(0)" onClick="location.href='utama.php?module=mod_mtindakan&view=form_tambah'">
			<button class="button">Tambah</button>
		</a>
	</div>
	<div class="clear"></div>
</div>

<?php
	if(!empty($_GET['nama'])){
		$param_nama=$_GET['nama'];
	}else{
		$param_nama=$_POST['nama'];
	}
?>
<table class="tbl_cari">
	<tr>
		<form method=post action='utama.php?module=mod_mtindakan'>
		<td width="65">Pencarian  : </td>
		<td width="200"><input type="text" name="nama" value="<?php echo $param_nama; ?>" class="input_field" /></td>
		<td></td>
		<td><input name="submit" type="submit" class="button" value="Cari" /></td>
		</form>
		<form method="post" enctype="multipart/form-data" action="module/mod_mtindakan/proses.php">
		<td>Import CSV :</td>
		<td><input name="userfile" type="file"></td>
		<td><input name="upload" type="submit" class="button" value="Import"></td>
		<td align="right">
			<a href="module/mod_mtindakan/cetak.php">
				<img src="asset/images/print.png" width="30">
			</a>
		</td>
		</form>
	</tr>
</table>

<table class="tabel">
	<tr>
		<th>NO</th>
		<th>Aksi</th>
		<th>Nama tindakan</th>
	</tr>
	<?php
		$p= new paging ;
		$batas= 10;

		//cek halaman dan posisi halaman
		$posisi = $p ->cariposisi($batas) ;
		$sql="select id_tindakan,nama_tindakan from master_tindakan where nama_tindakan like '%$param_nama%' order by nama_tindakan limit $posisi,$batas";
		//echo $sql;
		$qry=mysql_query($sql);
		$no=$posisi + 1;
		if(mysql_num_rows($qry)>0){
		
			while($hasil=mysql_fetch_array($qry)){
	?>
				<tr>
					<td align="center" width="30"><?php echo $no;?></td>
					<td align="center" align="center" width="60">
						<a href="utama.php?module=mod_mtindakan&view=form_edit&id=<?php echo $hasil['id_tindakan'];?>">
						<img src="asset/images/edit.png" title="Ubah Data"></a> 
						<?php
							hapus_data2("'$hasil[id_tindakan]'","id_tindakan","master_tindakan","klaim_tindakan","tarif_tindakan","mod_mtindakan")
						?>
					</td>
					<td ><?php echo $hasil['nama_tindakan'];?></td>
				</tr>
				
		<?php
				$no++;
			}
		}else{
		?>
	
	<tr>
		<td colspan="7" align="center">Data tidak Ada </td>
	</tr>
	
	<?php
		}
	?>
</table>

<?php
	$sql2="select id_tindakan from master_tindakan where nama_tindakan like '%$param_nama%'" ;
	$query2=mysql_query($sql2);
	$jumlah_data=mysql_num_rows($query2);
	//dapatkan jumlah halaman
	$jumlah_halaman= $p->jumlahhalaman($jumlah_data,$batas);
	//cetak link
	$linkhalaman=$p->navhalaman($_GET['halaman'],$jumlah_halaman,$_SERVER['PHP_SELF']."?module=mod_mtindakan","nama=$param_nama");
	print($linkhalaman);
?>
        